//
//  CZDetailNoDataCell.swift
//  GZWeibo007
//
//  Created by OY on 15/12/25.
//  Copyright © 2015年 Apple. All rights reserved.
//

import UIKit

class CZDetailNoDataCell: UITableViewCell{
// MARK: - 属性
/// 消息内容
var message: String? {
didSet {
    messageLabel.text = message
}
}

required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
}
    override init(style: UITableViewCellStyle, reuseIdentifier: String?)
    {
        super.init(style: style, reuseIdentifier:
            reuseIdentifier)
        
        prepareUI()
        
    }

//准备UI
private func prepareUI() {
    // 添加子控件
    contentView.addSubview(messageLabel)
    
    // 添加约束
    messageLabel.translatesAutoresizingMaskIntoConstraints = false
    
    contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|-0-[ml]-0-|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["ml": messageLabel]))
    contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|-0-[ml(100)]-0-|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["ml": messageLabel]))
}

// MARK: - 懒加载
private lazy var messageLabel: UILabel = {
    let label = UILabel()
    
    label.textAlignment = NSTextAlignment.Center
    label.textColor = UIColor.lightGrayColor()
    label.font = UIFont.systemFontOfSize(14)
    label.backgroundColor = UIColor.whiteColor()
    
    return label
}()
}


   